//package test.my.com.myapplicationtest.sliding_menu;
//
//import android.app.Activity;
//import android.os.Bundle;
//import android.support.design.widget.TabLayout;
//import android.support.v4.app.Fragment;
//import android.support.v4.app.FragmentActivity;
//import android.support.v4.view.ViewPager;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.widget.AdapterView;
//import android.widget.ListView;
//import android.widget.Toast;
//
//import com.jeremyfeinstein.slidingmenu.lib.SlidingMenu;
//import com.jeremyfeinstein.slidingmenu.lib.app.SlidingFragmentActivity;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import butterknife.Bind;
//import butterknife.ButterKnife;
//import test.my.com.myapplicationtest.R;
//import test.my.com.myapplicationtest.fragment_tab_host.FristFragment;
//import test.my.com.myapplicationtest.fragment_tab_host.SecondFragment;
//import test.my.com.myapplicationtest.fragment_tab_host.ThridFragment;
//import test.my.com.myapplicationtest.text_input_layout.LeftMenuAdapter;
//import test.my.com.myapplicationtest.text_input_layout.LeftMenuEntity;
//
///**
// * Author : Cooper
// * Time : 2016/9/12  14:22
// * Description : 实验SlidingMenu
// */
//public class SlidingMenuActivity extends SlidingFragmentActivity {
//
//    @Bind(R.id.tab)
//    TabLayout tab;
//    @Bind(R.id.viewPager)
//    ViewPager viewPager;
//
//    private SlidingMenu mSlidingMenu;
//
//    private View LeftMenuView;
//    private ListView leftMenuLv;
//
//    private List<String> titleList = new ArrayList<>();
//    private List<Fragment> fragmentList = new ArrayList<>();
//    private List<LeftMenuEntity> leftMenuEntityList = new ArrayList<>();
//
//    private String[] menuNames = {"我的消息","积分商城","会员中心","在线听歌免流量",
//            "听歌识曲","主题换肤","夜间模式"};
//    private int[] icons = {R.drawable.topmenu_icn_msg,R.drawable.topmenu_icn_store,
//            R.drawable.topmenu_icn_vip,R.drawable.topmenu_icn_free,R.drawable.topmenu_icn_identify,
//            R.drawable.topmenu_icn_night,R.drawable.topmenu_icn_skin};
//
//    @Override
//    public void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        setContentView(R.layout.aty_sliding_menu_layout);
//        ButterKnife.bind(this);
//        initSlidingMenu();
//        initView();
//        initLeftMenu();
//    }
//
//    private void initSlidingMenu() {
//        mSlidingMenu = getSlidingMenu();
//        mSlidingMenu.setMode(SlidingMenu.LEFT);
//        mSlidingMenu.setTouchModeAbove(SlidingMenu.TOUCHMODE_MARGIN);
//        mSlidingMenu.setBehindOffsetRes(R.dimen.left_menu_offset_400);
//        mSlidingMenu.setShadowDrawable(R.drawable.shadow);
//        mSlidingMenu.setShadowWidthRes(R.dimen.fab_margin);
//        mSlidingMenu.setFadeDegree(0.9f);
//    }
//
//    private void initLeftMenu() {
//        LeftMenuView = LayoutInflater.from(this).inflate(R.layout.slidingmenu_left_menu_layout,null);
//        leftMenuLv = (ListView) LeftMenuView.findViewById(R.id.left_menu_lv);
//        for (int i=0;i<5;i++) {
//            LeftMenuEntity leftMenuEntity = new LeftMenuEntity();
//            leftMenuEntity.icon_rs = icons[i];
//            leftMenuEntity.menuName = menuNames[i];
//            if (i == 3) {
//                leftMenuEntity.isShowLine = true;
//            }
//            leftMenuEntityList.add(leftMenuEntity);
//        }
//        LeftMenuAdapter leftMenuAdapter = new LeftMenuAdapter(this, leftMenuEntityList);
//        leftMenuLv.setAdapter(leftMenuAdapter);
//        leftMenuLv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
//            @Override
//            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
//                mSlidingMenu.toggle();
//                Toast.makeText(SlidingMenuActivity.this,leftMenuEntityList.get(i).menuName,Toast.LENGTH_SHORT).show();
//            }
//        });
//        setBehindContentView(LeftMenuView);
//    }
//
//    private void initView() {
//        titleList.add("综合");
//        titleList.add("新闻");
//        titleList.add("体育");
//        titleList.add("娱乐");
//
//        fragmentList.add(new FristFragment());
//        fragmentList.add(new SecondFragment());
//        fragmentList.add(new ThridFragment());
//        fragmentList.add(new SecondFragment());
//
//        SMViewPagerAdapter smAdapter = new SMViewPagerAdapter(getSupportFragmentManager(),titleList,fragmentList);
//        viewPager.setAdapter(smAdapter);
//        tab.setupWithViewPager(viewPager);
//    }
//}
